<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""DTD/xhtml1-strict.dtd">
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/c.tld" prefix="c"%>
<%@taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%>
<%@taglib uri="/WEB-INF/el.tld" prefix="el"%>
<%@taglib uri="/WEB-INF/fn.tld" prefix="fn"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<title></title>
		<c:import url="/includes/css_inc.jsp"/>
		<c:import url="/includes/js_inc.jsp"/>
		<script>
			$(function() {
		        $("[name=btnCancel]").button({
		            icons: {
		                primary: "ui-icon-arrowreturnthick-1-w"
		            },
            		text: false
		        });
				$("#search").button({
		            icons: {
		                primary: "ui-icon-search"
		            }
		        }).click(function(){
		        	if (validateEmpty()) {
		        		$("#saveForm").submit();
		        	}
		        });
			});

			function cancel(budgetYear, provinceId){
				if(confirm('ยืนยันการยกเลิกดำเนินการ?')==true){
					window.location='${pageContext.request.contextPath}/acc6?app=ACC60109&job=cancel&budgetYear='+budgetYear+'&provinceId='+provinceId;
				}
			}
		</script>
	</head>
	<body>
		<c:set var="auth" value="${el:getMapValue(menuAuth, 'ACC60108')}"/>
		<c:import url="/apps/msg.jsp"/>
		<form class="acc67-form" name="saveForm" id="saveForm" action="${pageContext.request.contextPath}/acc6" method="post">
		<input type="hidden" name="app" id="app" value="ACC60109"/>
		<input type="hidden" name="job" id="job" value="${job}"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="2"><b>${screenCode.ACC60108}</b></th>
			</tr>
			<tr>
				<td class="bold" width="20%">ปีงบประมาณ : </td>
				<td>
					<select name="budgetYear" id="budgetYear">
						<option value="">----- เลือก -----</option>
						<c:forEach var="budgetYearData" items="${listBudgetYear}">
							<c:if  test="${budgetYear == budgetYearData.BUDGET_YEAR}" var="sel"/>
							<option value="${budgetYearData.BUDGET_YEAR}" ${sel?'selected':''}>${budgetYearData.BUDGET_YEAR}</option>
						</c:forEach>
					</select><span id="$budgetYear" class="red">*</span>
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<c:if test="${fn:contains(auth, 'S')}">
						<button id="search" type="button" class="acc67-button">ค้นหาข้อมูล</button>
					</c:if>
				</td>
			</tr>
		</table>
		<c:if test="${!empty lsResult}">
		<br>
			<c:set var="sum" value="0"/>
			<table class="acc67-grid ui-widget ui-widget-content" width="100%" cellpadding="1" cellspacing="1">
				<tr>
					<th class="ui-state-default">จังหวัด</th>
					<th class="ui-state-default" width="15%">จำนวนยอดยกมา</th>
					<th class="ui-state-default" width="12%">ยกเลิกการยืนยัน</th>
				</tr>
				<c:forEach items="${lsResult}" var="data" varStatus="x">
					<tr class="grid-tr-${x.count % 2}">
						<td>${data.PROVINCE_NAME}</td>
						<td align="right"><fmt:formatNumber pattern="#,##0.00"  value="${data.SUM_BALANCE_AMOUNT}"/></td>
						<td align="center">
							<button type="button" name="btnCancel" id="btnCancel" class="acc67-button"  onclick="cancel('${data.BUDGET_YEAR}','${data.PROVINCE_ID}')"/>
						</td>
					</tr>
				</c:forEach>
			</table>
			</fieldset>
			</c:if>
		</form>
	</body>
</html>